﻿using UnityEngine;
using System.Collections;

public class EnemyRaycast : MonoBehaviour {

	
	public float LockOn(){
		//Ray2D ray;
		RaycastHit hit;

		if(Physics.Raycast(transform.position, transform.forward, out hit, 20f)){
			Debug.DrawLine (transform.position, hit.point);
			if(hit.transform.tag.Equals("Player")){
				//shoot
				print (hit.transform.name +" Shoot");
				return hit.distance;
			}
		}
		return 2000f;
	}
}
